home *** CD-ROM | disk | FTP | other *** search
- /* file: BigEasy2.h
- *
- * A set of routines to allow the quick development
- * of simple Macintosh applications.
- *
- */
-
- #ifndef BigEasyIncludes
- #define BigEasyIncludes
-
- /************************************
- * Simple things
- ************************************/
-
- typedef char s8;
- typedef unsigned char u8;
- typedef short s16;
- typedef unsigned short u16;
- typedef long s32;
- typedef unsigned long u32;
-
- typedef void (*FP)(); /* Function Pointer */
-
- typedef struct DitlItem
- {
- long placeholder;
- Rect displayRect;
- unsigned char type;
- char title[1];
- } DitlItem;
- typedef DitlItem * DItemPtr;
-
- typedef struct
- {
- int count;
- DitlItem item[1];
- } Ditl;
- typedef Ditl * DitlPtr;
- typedef DitlPtr * DitlHndl;
-
-
- #ifndef graphicsTypesIncludes
- typedef Boolean boolean;
- #define nil (0L)
- #endif
-
- #define SwapShort(a,b) {short temp; temp = a; a = b; b = temp;}
-
- #ifdef applec /* to kill apple c unused var warnings */
- #define UseVar(x) gXyzzyBucket = (long)x;
- #else
- #define UseVar(x)
- #endif
-
- /************************************
- * BigEasy2 Public Global Variables
- ************************************/
- #ifdef BigEasy2
- #define VAR
- #else
- #define VAR extern
- #endif
-
- VAR boolean gQuitApp;
- VAR boolean gMenuNeedsCmdKey;
- VAR boolean gStaggerWindows;
- VAR short gLastModifiers;
-
-
- VAR Rect gBigRect;
-
- #ifdef applec
- VAR long gXyzzyBucket; /* place to use variables */
- #endif
-
- #undef VAR
-
- /************************************
- * Major BigEasy2 Routines
- ************************************/
-
- WindowPtr InstallWindow(short iNum,s8 *iTitle,Rect *iRect,short iType,boolean iGrow,
- FP iUpdate,FP iClick,FP iKey,FP iGoAway,
- FP iActivate,FP iDeactivate,FP iIdle, boolean color);
-
- void UninstallWindow(short iNum);
-
- void Show(short inum);
- void Hide(short iNum);
- void InvalSubport(short wNum,short iNum);
- void InvalSubports(short wNum,s32 ref);
-
- void InstallMenu(char s[],FP action,short ref);
- void InstallItem(char s[],FP action,short ref);
- void SetMenuItem(short ref,char enable,char isMarked,char mark,char s[]);
- void EnDisEdits(short Eundo,short Ecut,short Ecopy,short Epaste,short Eclear);
- void InstallEditMenu(FP,FP,FP,FP,FP);
-
- void SetMasterIdle(FP);
-
- short SetSubport(short wNum,short aSub,Rect *r);
- void GetWindowRect(short n,Rect *r);
- WindowPtr GetWindowPtr(short n);
- boolean GetWindowVisible(short n);
- void Replace1Resource(Handle,s32 type,short id);
- void SaveWindowPosition(short n);
- void ForgetWindowPosition(short n);
-
- void GoWatch(void);
- void GoCursor(short c);
-
- void FailNil(long);
- void FailOSErr(long);
-
- /************************************
- * Client Provided BigEasy2 Routines
- ************************************/
-
- void Bootstrap(void);
- void Hatstrap(void);
-
- /************************************
- * Major BigEasy2 Structures
- ************************************/
-
- typedef struct tWindowObject
- {
- boolean wUsed; /* is this object used (in BigEasy's list)? */
- boolean wGrowable;
- FP wUpdateProc;
- FP wClickProc;
- FP wKeyProc;
- FP wGoAwayProc;
- FP wActivateProc;
- FP wDeactivateProc;
- FP wIdleProc;
- WindowPtr wWindow;
- } tWindowObject;
-
-
- /************************************
- * Minor BigEasy2 Hacks
- ************************************/
- #ifndef BigEasy2
- #define FailNil(x) FailNil((long)(x)) /* Simulate a typeless call */
- #define FailOSErr(x) FailOSErr((long)(x)) /* Simulate a typeless call */
- #endif
-
- #define Ticks (*(long *)0x16a)
-
- #endif